import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import { getCategoryAPI } from "@/apis/layout.js";
//两个组件调用一个数据 调用一次
export const useCategoryStore = defineStore('category', () => {
    //编写导航列表的 数据管理
    let CategoryList = ref([]);
    //获取数据
    const getCategory = async () => {
        const res = await getCategoryAPI();
        CategoryList.value = res?.result;
    };
    return { CategoryList, getCategory }
})
